package com.gongj.message;

import com.gongj.event.UserService;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

import java.util.Locale;

@ComponentScan(basePackages = {"com.gongj.message"})
public class AppApplication {


	public static void main(String[] args) {
		AnnotationConfigApplicationContext context =
				new AnnotationConfigApplicationContext(AppApplication.class);
		MessageSource messageSource = context.getBean(MessageSource.class);

		String zhMessage = messageSource.getMessage("user.myName", null, null, Locale.SIMPLIFIED_CHINESE);
		String enMessage = messageSource.getMessage("user.myName", null, null, Locale.ENGLISH);

		System.out.println("zh = " + zhMessage);

		System.out.println("en = " + enMessage);
	}
}
